Fulham came from behind to beat bottom-of-the-table Rotherham and move to within two points of the play-offs.